#:kivy 1.6.0
#:import DisableableButton ui.disableable_button.DisableableButton
#:set btn_hint_x 1
#:set btn_hint_y 0.2
#:import FittableLabel ui.fittable_widgets.FittableLabel
#:import FittableButton ui.fittable_widgets.FittableButton
#:import FittableButton ui.fittable_widgets.FittableButton

<StartGame>:
    start_btn: start_btn
    type_label: type_label
    add_player_btn: add_player_btn
    players_list: players_list
    joinable_btn: jbtn
    orientation: 'vertical'
    size: root.size
    BoxLayout:
        orientation: 'horizontal'
        size_hint_y: None
        height: root.height*0.1
        FittableButton:
            color: 1,0,0,1
            id: start_btn
            text: _('Back')
            on_release: root.go_back()
        DisableableButton:
            color: [0,1,0,1] if self.enabled else [1,1,1,1]
            id: start_btn
            text: _('Start')
            on_release: root.start_btn_released()
    BoxLayout:
        orientation: 'horizontal'
        size_hint_y: btn_hint_y
        DisableableButton:
            color: 0,1,0,1
            id: add_player_btn
            text: _('Add player')
            on_release: root.add_player()
        DisableableButton:
            id: jbtn
            text: _('Make joinable')
            on_release: root.make_joinable()
    FittableLabel:
        id: type_label
        size_hint_y: 0.1
        text: _('Local game')
    ScrollView:
        do_scroll_x: False
        GridLayout:
            id: players_list
            cols: 1
            size_hint_y: None

<PlayerNameLayout>:
    #height: root.root.height * 0.1
    width: root.root.width if self.parent else self.width
    #size_hint_y: None
    FittableLabel:
        text: root.name
    FittableButton:
        text: '-'
        size_hint_x: None
        width: self.height
        on_release: root.delete_player(root.index)